#pragma once

#include <engine.core/math.hpp>

#include "exports.hpp"




/**
 * The ActorKinematics structure contains all variables that describe an actor's state in space-time.
 */
struct ENGINE_PHYSICS_API ActorKinematics
{
	//
	// Kinematic quantities
	// They describe the current state of our body
	//

	// Body constants
	const float_t     mass; //< M, the total mass of the body
	const matrix3x3   invInertiaTensor; //< I^-1, inverse inertia tensor of the CM in object space

	// Linear
	vector3           position;       //< r, the position equals the center of mass
	vector3           linearVelocity; //< v, the velocity of the center of mass

	// Angular
	matrix3x3         rotation;        //< A, the rotation of the body (transforms object- to world space)
	vector3           angularMomentum; //< L, the angular momentum (not the velocity)

	// Auxiliary quantities
	matrix3x3         invWorldInertiaTensor; //< I^-1, inverse inertia tensor of the CM in world space
	vector3           angularVelocity;       //< w, the angular velocity



	/**
	 * Create an ActorKinematics structure with the following mass an inertia tensor.
	 */
	ActorKinematics(float_t mass, const matrix3x3& inertiaTensor, const vector3& position, const vector3& velocity, const matrix3x3& rotation);
};
///////////////////////////////////////////////////////////////////////////////////////////////////
